//
//  SinaTempController.swift
//  SinaWeibo
//
//  Created by 王朝阳 on 2016/10/23.
//  Copyright © 2016年 wangzhaoyang. All rights reserved.
//

import UIKit

class SinaTempController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        setupUI()
    }
    
    //MARK: - 监听点击事件
    @objc private func pushClick() {
        
        let tempVC = SinaTempController()
        
        //跳转之前,设置跳转后隐藏标签栏
//        tempVC.hidesBottomBarWhenPushed = true
        navigationController?.pushViewController(tempVC, animated: true)
    }
    
    //MARK: - 设置视图
    private func setupUI() {
        
        view.backgroundColor = UIColor.white
        
        setupNav()
    }
    //MARK: - 设置导航条
    private func setupNav() {
        
        navigationItem.rightBarButtonItem = UIBarButtonItem(setHighlightedImgName: nil, title:"PUSH", target: self, action: #selector(pushClick))
        
        //设置 push 后的导航条的文字
        navigationItem.title = "是\(navigationController?.childViewControllers.count ?? 0)个控制器"
    }
}
